﻿using UnityEngine;
using System.Collections;

public class ObjectPusher : MonoBehaviour {
	public ObjectPool shipPool;
	public ObjectPool blasterPool;
	void Start() {
		//Debug.Log ("trigger?: " + collider2D.isTrigger);
	}
	void OnTriggerEnter2D(Collider2D collider) {
		if(collider.GetComponent<Blaster>() != null) {
			collider.GetComponent<Blaster>().pushToPool();
			//Debug.Log ("blaster fire detected");
		}
		if(collider.GetComponent<EnemyShipFlight>() != null) {
			Debug.Log ("ship detected");
			shipPool.pushToPool(collider.gameObject);
		}
	}
	// Update is called once per frame
	void Update () {
		
	}
}
